﻿ #region 私有方法

        private void RefreshTreePath(params int[] ids)
        {
            if (ids.Length == 0)
            {
                return;
            }
            List<CRM_product_category> objs = CRM_product_categoryRepository.GetInclude(m => m.Parent).Where(m => ids.Contains(m.Id)).ToList();
            UnitOfWork.TransactionEnabled = true;
            foreach (var obj in objs)
            {
                obj.TreePath = obj.Parent == null
                    ? obj.Id.ToString()
                    : obj.Parent.TreePathIds.Union(new[] { obj.Id }).ExpandAndToString();
                CRM_product_categoryRepository.Update(obj);
            }
            UnitOfWork.SaveChanges();
        }

        #endregion